package com.tiancheng.trade.order.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 银行卡状态枚举
 *
 * @author kellen
 * @date 2024/3/3
 */
@Getter
@AllArgsConstructor
public enum CardActivateStatusEnum implements BaseEnum<String> {

	WAIT("0", "处理中(初始值)"),
	SELECT_CARD("1", "用户已选卡，但未绑卡"),
	SUCCESS("2", "成功(开通绑卡成功)"),
	FAIL("3", "交易失败(开通绑卡失败)"),
	INVALID("4", "交易失败，sn失效"),
	UNBOUNDED("5", "已解绑"),
	REPEAT_BOUNDED("6", "交易失败(重复绑卡)"),
	;

	private String code;
	private String desc;

	public static String getDesc(String code) {
		CardActivateStatusEnum[] businessModeEnums = values();
		for (CardActivateStatusEnum statusEnum : businessModeEnums) {
			if (statusEnum.code().equals(code)) {
				return statusEnum.desc();
			}
		}
		return null;
	}

	public String code() {
		return this.code;
	}

	public String desc() {
		return this.desc;
	}
}
